<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<!--{include file='comm/header.tpl'}-->
	<title>发布文件列表</title>
	<script>
		//将导出的代码发布到测试环境
		function issue_export_file (revision) {	
			if (revision == '' || !E.isDigital(revision)) {
				E.alert('参数错误，无法操作');
				return;
			}
			
			var addForm = getValueOfForm('#addForm');
			$.ajax({
				type: "POST",
				url: "/invokingAjax-backend/project/issueInfo.ajax?operFlg=5",
				dataType: "JSON",
				data:{'versionNumber' : revision, 'formValue': addForm},
				success: function( result_obj ) {
                        if (result_obj.code == 200) {
                            E.opener("source.load");
                            E.alert(result_obj.message,  2, "E.closeWindows");
                        } else {
                            E.alert(result_obj.message);
                        }
                    }
			});
		}
		
		//比较线上的文件与发布文件的区别
		function do_compare (fileName,revision) {
			if (fileName == '' || revision == '' || !E.isDigital(revision)) {
				E.alert('参数错误，无法操作');
				return;
			}
			$.ajax({
				type: "POST",
				url: "/invokingAjax-backend/project/issueInfo.ajax?operFlg=6",
				dataType: "JSON",
				data:{'versionNumber' : revision, 'fileName' : fileName},
				success: function( result_obj ) {
                        if (result_obj.code == 200) {
                            
							$('#compare_confirm_msg').html(result_obj.message);
							$('#compare_confirm .pb-content').css('width','400px');
							$('#compare_confirm').show();
							
                        } else {
                            E.alert(result_obj.message);
                        }
                    }
			});
		}
		
		function compare_close(){
			$('#compare_confirm').hide();
		}
		
		//获取表单的值，组成Json数组
		function getValueOfForm (form){
			var serializeObj = {};
			var array = $(form).serializeArray();
			var str = $(form).serialize();
			$(array).each(function(){
				if (serializeObj[this.name]) {
					if ($.isArray(serializeObj[this.name])) {
						serializeObj[this.name].push(this.value);
					}else{
						serializeObj[this.name]=[serializeObj[this.name],this.value];
					}
				}else{
					serializeObj[this.name]=this.value;
				}
			});
			return serializeObj;
		}
	</script>
</head>
<body>

	<div style="width:100%">
		
		<div class="items clearfix">
			<h2 style="" class="tal">导出发布的文件列表：</h2>
			
			<div class="items2">
				<!--{if $error_msg}-->
	            
				<div class="comm-box">
	                <div style="position:relative;color: red;">
	                    <!--{$error_msg}-->
	                </div>
	            </div>
				
	            <!--{else}-->
				
				<form id="addForm" name="addForm">
					  请选择在下列项目发布：
                                        <div>
                                                <input type="checkbox" name="dataBase" value="1" checked="checked">&nbsp;测试服务器&nbsp;
                                        </div>
				</form>
				
				<table>
					<!--{foreach from=$fileArr item=fileList}-->
						<tr>
							<td width="100%" class="td_input"><!--{$fileList}--></td>
							<!--<td width="*" align='center'>
								<a href="javascript:void(0);" onclick="do_compare('<!--{$fileList}-->','<!--{$versionNumber}-->');">对比</a>
							</td>-->
						</tr>
					<!--{/foreach}-->
				</table>
				
				<!--{/if}-->
			</div>
			
		</div>
		
		<div class="bottom_fixbox">
			<div class="rectbox tac">
	        	<input type="button" class="btn send_b" onclick="issue_export_file('<!--{$versionNumber}-->');" value="发布">
				<input type="button" class="btn cancel_b" onclick="E.closeWindows();" value="取消">
	        </div>
		</div>

	</div>

</body>
</html>
